<!DOCTYPE html>
<style>
  .floated { float:left; }
</style>
<div id="container">
  <span id="inline"></span>
  <div id="block"></div>
  <div id="firstFloat" class="floated"></div>
  <div id="secondFloat"></div>
  <div id="thirdFloat" class="floated"></div>
  <span></span>
  <div></div>
</div>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
  test(() => {
    document.body.offsetTop;
    document.getElementById("secondFloat").className = "floated";
    document.documentElement.offsetTop;
    document.getElementById("inline").appendChild(document.getElementById("block"));
    document.body.offsetTop;
    document.getElementById("thirdFloat").className = "";
    document.documentElement.offsetTop;
    document.getElementById("container").style.display = "none";
  }, "PASS if no crash");
</script>
